#-*- coding: utf8 -*-
from tutor.scripts import *
from tutor.plugins.sympy import *

while True:
    with display_block('Entradas'):
        S = sqrt(rfraction(4, force_pos=True))

    with display_block('Resultados'):
        resps = [S ** 3 / 27, S]

        for frac in rfractions(force_pos=True, max_size=30):
            if len(resps) >= 6:
                break
            new = oneof(*resps) * frac
            if new not in resps:
                frac = (new.args[0] if type(new) is Mul else new)
                if issimple(frac, 5):
                    resps.append(new)

        try:
            correta, soma, distr1, distr2, distr3, distr4 = resps
        except ValueError:
            continue
        else:
            break
